<?php
	require_once './includes/Config.inc.php';
	
	$cfg = Config::getInstance();
	
	$myUid = $cfg->getFacebook()->require_login();
	$user = User::getUserFbID($myUid);
	
	if($user == false) {
		$user = new User();
		$user->fb_id = $myUid;
		$user->save();
	}
	
	$Smarty = $cfg->getSmarty();
			
	if (isset($_GET['page']) && array_key_exists($_GET['page'], $cfg->pages_ok))
		include($cfg->pages_ok[$_GET['page']]);
	else
		include($cfg->pages_ok['home']);
	
	$Smarty->display('common.tpl');
?>
